# include <bits/stdc++.h>
using namespace std;
int n, nk, sum, i, k;
long t;
int a[7];
int main() { 
    cin >> n >> k;
    nk = n / k;
    t = 0, i = 1, a[i] = 1, sum = n - 1;
    do { 
        if(i == k) { 
            t++, a[i] = a[i - 1], sum -= a[i];
        } else { 
            i--, a[i]++;
            sum += a[i + 1] - 1;
        }
    } while(a[1] <= nk);
    printf("%ld\n", t);
}
